/*
 * File:   HumanPlayer.cpp
 * Author: Elevator
 *
 * Created on 15 Июнь 2013 г., 19:58
 */

#include "HumanPlayer.h"

HumanPlayer::HumanPlayer( ) :
	_creature( 0 )
{
}

HumanPlayer::HumanPlayer( Creature* creature ) :
	_creature( creature )
{
}

HumanPlayer::~HumanPlayer( )
{
}

Creature* HumanPlayer::GetCreature( ) const
{
	return _creature;
}

void HumanPlayer::SetCreature( Creature* creature )
{
	_creature = creature;
}

void HumanPlayer::KeyPressed( core::KeyboardKey key )
{
	_creature->ProcessCommand( Command( CommandType::Press, key ) );
}

void HumanPlayer::KeyReleased( core::KeyboardKey key )
{
	_creature->ProcessCommand( Command( CommandType::Release, key ) );
}

void HumanPlayer::ButtonPressed( core::MouseButton button )
{
	_creature->ProcessCommand( Command( CommandType::Press, button ) );
}

void HumanPlayer::ButtonReleased( core::MouseButton button )
{
	_creature->ProcessCommand( Command( CommandType::Release, button ) );
}

void HumanPlayer::OnMove( Vec2 pos )
{
	_creature->ProcessCommand( Command( CommandType::Move, 0 ) );
}

void HumanPlayer::OnWheel( int pos )
{
	_creature->ProcessCommand( Command( CommandType::Send, pos ) );
}
